package com.tx.java.chapter3;


import java.util.Random;

public class ConvertClass {

    public float aFloat;

    public static float cacaluteSpeed(float s,float second){
        return s/second;
    }

    public static void main(String[] args) {
        ConvertClass c1 = new ConvertClass();
        c1.aFloat =  10;
        ConvertClass c2 = new ConvertClass();
        c2.aFloat = 20;

        System.out.println(c1.aFloat+"-----"+c2.aFloat);

        ConvertClass c3 = c1;
        c3.aFloat = 1;
        System.out.println(c1.aFloat+"-----"+c3.aFloat);

        Random r = new Random();
        float s = r.nextFloat();
        float l = r.nextFloat();
        System.out.println(cacaluteSpeed(s,l));

        int a = 8;
        int b = 7;
        System.out.println("&:"+(a & b));
        System.out.println("|:"+(a | b));
        System.out.println("^:"+(a ^ b));
        System.out.println("~:"+(~(a & b)));
        System.out.println("~:"+(~(a | b)));
        System.out.println("~:"+(~-9));
    }
}
